package xx.iverson.school_manage.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xx.iverson.school_manage.entity.Points;

import java.util.List;

/**
 * @author wei77
 */
@Mapper
public interface PointsMapper {
    //查询个人积分
    Integer selectPoints(Integer userId);

    //批量查询积分
    List<Points> selectListPoints(Integer number);

    //新建用户时初始积分
    Boolean insertPointsUser(@Param("userId") Integer userId, @Param("realName") String realName, @Param("points") Integer points);

    //添加积分
    Boolean insertPoints(@Param("userId") Integer userId, @Param("insertAccount") Integer insertAccount);

    //减少积分
    Boolean decreasePoints(@Param("userId") Integer userId, @Param("decreaseAccount") Integer decreaseAccount);

    //重置积分
    Boolean updatePoints();

    //重置积分记录
    Boolean insertResetPoints();

    //重置积分为0
    Boolean updatePointsZero();

    //重置积分为0记录
    Boolean insertResetPointsZero();

    //查询全部积分
    Integer getRank(Integer userId);

    //查询所有人积分
    List<Points> selectAllPoints();

    //模糊查询
    List<Points> selectLikePoints(String searchKey);

    //首字母查询
    List<Points> selectLetterPoints(String searchKey);
}
